package com.lxq.test1909.Main01;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n,m;
        n=sc.nextInt();
        m=sc.nextInt();

        int sum = 0;//苹果总数
        int appTreeId = 0;//疏果最多的树的编号
        int maxKillNum = 0;//疏果最多的数量

        for (int i=0;i<n;i++){
            int killNum = 0;//疏果数
            sum = sum + sc.nextInt();
            for (int j=0;j<m;j++){
                killNum = killNum + sc.nextInt();
            }
            if (killNum<maxKillNum){
                maxKillNum = killNum;
                appTreeId = i+1;
            }
            sum = sum + killNum;

        }
        System.out.println(sum+" "+appTreeId+" "+Math.abs(maxKillNum));

    }
}
